package xing.example;

import org.springframework.beans.PropertyEditorRegistry;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.convert.ConversionService;
import org.springframework.core.convert.support.ConfigurableConversionService;
import xing.example.bean.B;
import xing.example.config.converter.MyConversionService;
import xing.example.converter.StringToA;

@SpringBootApplication
public class Main {
    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(Main.class);
        B bean = context.getBean(B.class);
        System.out.println(bean.a.getI());

        System.out.println("--- ---");
//        ConversionService conversionService = context.getBeanFactory().getConversionService();
//        Object conversionService1 = context.getBean("conversionService");
//        System.out.println(conversionService1 == conversionService);
//
//        System.out.println(conversionService1);
//        ConversionService conversionService = context.getBean(ConversionService.class);
//        System.out.println(conversionService);

//        System.out.println("----");
//        Object conversionService = context.getBean("conversionService");
//        System.out.println(conversionService);
    }
}